home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Graphics / RTGmaster / devdocs / rtg3DExt.ad < prev    next >
Text File  |  1997-08-04  |  10KB  |  338 lines

  1. rtg3DExt/ClrZBuf                                            rtg3DExt/ClrZBuf
  2.  
  3.     NAME
  4.         ClrZBuf - Clears the Z Buffer
  5.  
  6.     SYNOPSIS
  7.         void ClrZBuf(RtgScreen)
  8.                       A0
  9.  
  10.         void ClrZBuf(struct RtgScreen *)
  11.  
  12.     FUNCTION
  13.         Clears the Z Buffer. This function does not work yet.
  14.  
  15.     INPUTS
  16.         RtgScreen - The used RtgScreen
  17.  
  18.     SEE ALSO
  19.  
  20. rtg3DExt/ClearBuf                                           rtg3DExt/ClearBuf
  21.  
  22.     NAME
  23.         ClearBuf - Clears a Doublebuffering Buffer
  24.  
  25.     SYNOPSIS
  26.         void ClearBuf(RtgScreen,BufNum)
  27.                        A0        D0
  28.  
  29.         void ClearBuf(struct RtgScreen *, ULONG)
  30.  
  31.     FUNCTION
  32.         This function is used to clear the Back Buffer (it can also clear
  33.         the front buffer, but this does not make sense). This function
  34.         needs at least rtgCV3D.library V2.43 to work correctly.
  35.  
  36.         Note that a
  37.         rtgCV3D.library screen (and possible screens of other 3D Sublibs also)
  38.         can only do 2 buffers, not 3.
  39.  
  40.         Also note, that ClearBuf ONLY works if you do NOT promote the Screen !!!
  41.         This CANNOT be fixed, never promote a rtgCV3D.library screen, or you get
  42.         much flickering.
  43.  
  44.     INPUTS
  45.         RtgScreen - The RtgScreen
  46.         BufNum    - Number of the Buffer to clear
  47.  
  48.     SEE ALSO
  49.  
  50. rtg3DExt/CreateTex                                          rtg3DExt/CreateTex
  51.  
  52.     NAME
  53.         CreateTex - Creates a Texture Handle
  54.  
  55.     SYNOPSIS
  56.         struct TexHandle *CreateTex(RtgScreen,Tags)
  57.                 D0                   A0        A1
  58.  
  59.         struct TexHandle *CreateTex(struct RtgScreen *,struct TagItem *)
  60.  
  61.     FUNCTION
  62.         This function creates a texture handle. The provided tags list, which
  63.         features of the 3D Engine are to be used.
  64.  
  65.         tex_TexMap:     Address of the Texture-Map, which should be uploaded to the
  66.                         Graphics Memory. Note: This is not the Address of the Texturemap
  67.                         HANDLE, it is the address of the Texture itself !!!
  68.  
  69.         tex_MapSize:    The Size of this Map
  70.  
  71.         tex_ColorFmt:   The Color Format of the Texture-Map
  72.  
  73.         tex_FilterType: The Filtering Type, that should be used for Texture Filtering
  74.  
  75.         tex_TexWrap:    Boolean Flag, if Texture-Wrapping should be used
  76.  
  77.         tex_LitTex:     Boolean Flag, if Lit-Texturing should be used
  78.  
  79.         tex_AlphaBlend: The Alpha-Blending config
  80.  
  81.         Take note, that uploading a texture to GFX Memory should only be done
  82.         at times where speed is not important. Also take note, that there
  83.         will be a "Screenmode-System" for Color-Formats and Filter-Types to
  84.         support Multiple Chipsets in a later version of this library. Also
  85.         take note, that this call is still to be expanded, and that you also
  86.         should check your Chipset3D structure if a certain operation is
  87.         available.
  88.  
  89.         The Alpha Blending Values are :
  90.  
  91.         ABlend_Source  = -1
  92.         ABlend_None    =  0
  93.         ABlend_Texture =  1
  94.  
  95.         The Blending Values are :
  96.  
  97.         Blend_Com      =  0
  98.         Blend_Mod      =  1
  99.         Blend_Decal    =  2
  100.  
  101.         The Color Formats are :
  102.  
  103.         ARGB32         =  0
  104.         ARGB16         =  1 (RGB4444 !!!)
  105.         ARGB15         =  2 (RGB1555 !!!)
  106.         ALP4BLE4       =  3
  107.         BLEND4LO       =  4
  108.         BLEND4HI       =  5
  109.         LUT8           =  6 (Palletized Data)
  110.         YUYV16         =  7 (YUV Data)
  111.  
  112.         The Filter Types are :
  113.  
  114.         TPPM1          =  0 (MIP-Mapping, not yet supported)
  115.         TPPM2          =  1 (Linear MIP-Mapping, not yet supported)
  116.         TPPM4          =  2 (Bi-linear MIP-Mapping, not yet supported)
  117.         TPPM8          =  3 (Tri-linear MIP-Mapping, not yet supported)
  118.         TPP1           =  4 (Point Sampling)
  119.         TPPV2          =  5 (For YUV Data)
  120.         TPP4           =  6 (Bi-Linear Mapping)
  121.  
  122.         Also always have a look at the Chipset3D Flags:
  123.  
  124.         0 Fogging and Alpha Blending cannot happen at the same time on this chip
  125.         1 Alpha Blending Objects can cause problems with Z-Buffering on this chip
  126.         2 Wrap-Around is not supported for p-correct textures on this chip
  127.         3 In Palettized Mode, this Chip only supports Decal Blending
  128.         4 Gouraud Shading does not work in Palettized Mode (Reasonable :) )
  129.         5 Lit-Texturing does not work in Palettized Mode (Reasonable :) )
  130.  
  131.         The Chipset3D structure looks like the following, more info in 3DExt.guide:
  132.  
  133.         struct Chipset3D
  134.         {
  135.          struct Library *Base3D; // This is the LibBase of rtg3DExt !!!
  136.          int mapping;
  137.          int p_mapping;
  138.          int filters;
  139.          int tmapclr;
  140.          int fog;
  141.          int blend;
  142.          int ablend;
  143.          int zbuf;
  144.          int mux;
  145.          int gouraud;
  146.          int lit;
  147.          int line;
  148.          int wrap;
  149.          int ovl;
  150.          int mem;
  151.          int size;
  152.          int lsize;
  153.          int flags;
  154.         };
  155.  
  156.         The Chipset3D structure tells you the features of a chip, the max. size
  157.         of the textures, the 3DExt LibBase of the Chip, the Flags and how much
  158.         GFX Memory you have. You get the address of the structure using
  159.         GetRtgScreenData of rtgmaster.library. Z Buffering is enabled using
  160.         OpenRtgScreen of rtgmaster.library (but up to now it does not work).
  161.  
  162.         The function does not upload the texture. This has to be done manually,
  163.         or using LoadTex.
  164.  
  165.     INPUTS
  166.         RtgScreen - The RtgScreen to use
  167.         Tags      - The Tags to use
  168.  
  169.     RESULTS
  170.         TexHandle - Pointer to the TexHandle of the created Texture
  171.  
  172.     SEE ALSO
  173.         DeleteTex(),GetTexAttr(),SetTexAttr()
  174.  
  175. rtg3DExt/DeleteTex                                          rtg3DExt/DeleteTex
  176.  
  177.     NAME
  178.         DeleteTex - Frees a Texture Handle again.
  179.  
  180.     SYNOPSIS
  181.         DeleteTex(RtgScreen,th)
  182.                    A0       A1
  183.  
  184.         void DeleteTex(struct RtgScreen *,struct TexHandle *)
  185.  
  186.     FUNCTION
  187.         This function deletes a Texture Handle again. It does not free the memory
  188.         used by the Texture. This has to be done using FreeTex.
  189.  
  190.     INPUTS
  191.         RtgScreen - The RtgScreen to which the TexHandle was applied
  192.         TexHandle - The Handle of the Texture to be deleted
  193.  
  194.     SEE ALSO
  195.         CreateTex(),GetTexAttr(),SetTexAttr()
  196.  
  197. rtg3DExt/FreeTex                                            rtg3DExt/FreeTex
  198.  
  199.     NAME
  200.         FreeTex - Deletes a texture from GFX Memory again
  201.  
  202.     SYNOPSIS
  203.         void FreeTex(RtgScreen,Tex, size)
  204.                       A0        A1   D0
  205.  
  206.         void FreeTex(struct RtgScreen *,void *, int)
  207.  
  208.     FUNCTION
  209.         This function removes a texture from the Memory
  210.         Buffer again. The Memory Buffer is used as temporary
  211.         Buffer until CreateTex uploads the Texture is uploaded
  212.         to the GFX Memory. FreeTex clears this Buffer again.
  213.  
  214.     INPUTS
  215.         RtgScreen - The RtgScreen
  216.         Tex       - The Memory Buffer for the texture
  217.         size      - The Size of the Texture
  218.  
  219.     SEE ALSO
  220.         LoadTex()
  221.  
  222. rtg3DExt/GetTexAttr                                         rtg3DExt/GetTexAttr
  223.  
  224.     NAME
  225.         GetTexAttr - To get the values set in a TexHandle
  226.  
  227.     SYNOPSIS
  228.         ULONG GetTexAttr(RtgScreen,TexHandle,AttrNum)
  229.          D0               A0        A1        D0
  230.  
  231.         ULONG GetTexAttr(struct RtgScren *,struct TexHandle *,ULONG)
  232.  
  233.     FUNCTION
  234.         Using this function, you can re-read the value of the Attributes
  235.         you set using CreateTex. Not yet implemented.
  236.  
  237.     INPUTS
  238.         RtgScreen - The RtgScreen to use
  239.         TexHandle - The TexHandle to use
  240.         AttrNum   - The Attribute to change
  241.  
  242.     SEE ALSO
  243.         SetTexAttr()
  244.  
  245. rtg3DExt/LoadTex                                            rtg3DExt/LoadTex
  246.  
  247.     NAME
  248.         LoadTex - Uploads a texture to the GFX Memory
  249.  
  250.     SYNOPSIS
  251.         void LoadTex(RtgScreen,name, size)
  252.                       A0        A1    D0
  253.  
  254.         void LoadTex(struct RtgScreen *,void *,char *, int)
  255.  
  256.     FUNCTION
  257.         This function loads the Texture to a temporary Buffer (as it cannot
  258.         be uploaded from diskdrive to GFX Memory directly), before CreateTex
  259.         uploads it to the GFX Memory.
  260.  
  261.     INPUTS
  262.         RtgScreen - The RtgScreen to use
  263.         name      - The filename under which the texture data is stored
  264.         size      - The size of the texture
  265.  
  266.     SEE ALSO
  267.         FreeTex()
  268.  
  269. rtg3DExt/PaintT3D                                           rtg3DExt/PaintT3D
  270.  
  271.     NAME
  272.         PaintT3D - Paints textured or shaded triangles to the Screen
  273.  
  274.     SYNOPSIS
  275.         PaintT3D(RtgScreen,TexHandle,BlendType)
  276.                   A0        A1        D0
  277.  
  278.         void PaintT3D(struct RtgScreen *,struct TexHandle *,ULONG)
  279.  
  280.     FUNCTION
  281.         This function renders a triangle, specified as
  282.  
  283.         typedef struct
  284.         {
  285.          long x,y,z,u,v;
  286.          long color;
  287.         } Point3D;
  288.  
  289.         typedef struct
  290.         {
  291.          Point3D p1,p2,p3;
  292.          struct TexHandle *th;
  293.         } Triangle3D;
  294.  
  295.         The Triangle is described by three points with polygon- and
  296.         texture-coordinates. The color is for the use of Gouraud-Shading
  297.         or Lit-Texturing. The Texture-Handle indicates the texture to use.
  298.  
  299.         The BlendType can be used to light up or to darken the image. Normally
  300.         only 15/16/24 Bit Screens support this fully. You should use Doublebuffering
  301.         to display the textures. Sadly, i did not yet get this function work together
  302.         with Back-Bitmap-Clearing. But well... this is an Alpha Version.
  303.  
  304.     INPUTS
  305.         RtgScreen - The RtgScreen to use
  306.         TexHandle - The TexHandle to use
  307.         BlendType - The BlendType to use
  308.  
  309.     SEE ALSO
  310.         CreateTex()
  311.  
  312.  
  313. rtg3DExt/SetTexAttr                                         rtg3DExt/SetTexAttr
  314.  
  315.     NAME
  316.         SetTexAttr - To change the values set in a TexHandle
  317.  
  318.     SYNOPSIS
  319.         void GetTexAttr(RtgScreen,TexHandle,AttrNum,Value)
  320.                          A0        A1        D0      D1
  321.  
  322.         void GetTexAttr(struct RtgScren *,struct TexHandle *,ULONG,ULONG)
  323.  
  324.     FUNCTION
  325.         Using this function, you can re-set the value of the Attributes
  326.         you set using CreateTex with different values. Not yet implemented.
  327.  
  328.     INPUTS
  329.         RtgScreen - The RtgScreen to use
  330.         TexHandle - The TexHandle to use
  331.         AttrNum   - The Attribute to change
  332.         Value     - The new value
  333.  
  334.     SEE ALSO
  335.         GetTexAttr()
  336.  
  337.  
  338.